
import os
fileName = os.path.join(os.path.dirname(os.path.abspath(__file__)),'students.csv')
with open(fileName,mode='r') as fr:
    lines = fr.read().split('\n')
print(lines)
count= len(lines)-2
students = []
age_sum=0
height_sum = 0
lines.pop(0)
lines.pop(-1)
for i in lines:
    line = i.split(',')
    age_sum += int(line[2])
    height_sum += int(line[3])
    if int(line[2])>10:
        students.append(line[0])

print('学生的平均年龄:{}'.format(age_sum/count))
print('学生的平均身高:{}'.format(height_sum/count))
print('年龄大于10岁的学生姓名:{}'.format(','.join(students)))
